package com.itaming.lycheeframework.api.result;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 通用错误码枚举
 *
 * @author A.Ming
 */
@Getter
@RequiredArgsConstructor
public enum CommonErrorCode implements IErrorCode {

    /**
     * 操作成功
     */
    SUCCESS(0, "操作成功"),

    /**
     * 操作失败
     */
    FAILURE(990098, "操作失败"),

    /**
     * 服务器异常
     */
    INTERNAL_SERVER_ERROR(990099, "服务器异常"),

    /**
     * 请求相关
     */
    NOT_FOUND(990021, "资源不存在"),
    METHOD_NOT_ALLOWED(990022, "不支持当前请求方法"),
    UNSUPPORTED_MEDIA_TYPE(990023, "不支持当前媒体类型"),
    MISSING_PARAMETER(990024, "参数缺失"),
    PARAMETER_TYPE_MISMATCH(990025, "参数类型不匹配或格式错误"),
    PARAMETER_VALIDATION_FAILED(990026, "参数校验失败"),

    ;

    /**
     * 状态码
     */
    private final int code;

    /**
     * 消息
     */
    private final String message;

}
